package test19.writer_;

import java.io.*;

public class BufferedCopy_ {
    public static void main(String[] args) throws IOException {
            String srcPath = "D:\\资料\\a.txt";
            String destPath = "D:\\资料\\a2.txt";
            String data = "";
            BufferedReader bufferedReader = new BufferedReader(new FileReader(srcPath));
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(destPath));
        while((data=bufferedReader.readLine()) != null){
                bufferedWriter.write(data);
                bufferedWriter.newLine();
            }
        System.out.println("读取成功");
        bufferedReader.close();
        bufferedWriter.close();
    }
}
